/**
 * 
 */
package org.youisoft.summer.evaluator.operator;

import org.youisoft.summer.evaluator.context.CalContext;
import org.youisoft.summer.evaluator.operator.base.NullOperator;
import org.youisoft.summer.evaluator.operator.base.NumberOperator;
import org.youisoft.summer.evaluator.operator.base.StringOperator;

/**
 * @author zijiang.jl
 * Define the base operation
 *
 */
public interface Operator<T>{
	
	public static final NullOperator nullInstance=new NullOperator();
	
	/**
	 * 
	 * @return
	 */
	public T value();

	/**
	 * 
	 * @param value
	 * @return
	 */
	public Operator<T> setValue(T value);
	
	/**
	 * 
	 * @param <C>
	 * @param <R>
	 * @param <P>
	 * @param context
	 * @return
	 */
	public <C,R,P> Operator<?> prepareCall(CalContext<C,R,P> context);
	
	/**
	 * 
	 * @param <C>
	 * @param <R>
	 * @param <P>
	 * @param context
	 * @return
	 */
	public <C,R,P> Operator<?> postCall(CalContext<C,R,P> context);
	
	
	/**
	 * 
	 * @return
	 */
	public StringOperator convertToStringOperator();
	
	/**
	 * 
	 * @return
	 */
	public NumberOperator convertToNumberOperator();
	
	
}
